gamemode4fandomcom-20200215-history
Structure Population
V1.0= This is a base module used by the Orbis modules containing chests or spawners. It populates chests with seed/height specific loot and fills dungeons with spawners. Both the Custom Terrain Base and a structure module like Dangerous Dungeon is required. Details This module adds two changes - custom spawners and chests. Custom Spawners Spawners are generated in groups of four. There are two sets of spawners included with the structure population module (one for dungeons, one for towers) but more groups can be added by other modules. The spawner type is calculated based on the bedrock column directly beneath the spawner. There are four possible bedrock combinations, meaning a spawner set must contain four types of spawner. Spawners placed above each other will always be the same type, so the spawners in dungeons are placed so they are never directly above each other. Dungeon Spawners This is used by the Dangerous Dungeon expansion pack for custom terrain. Spawners have a chance to be Spider, Skeleton, Creeper or Zombie. They are standard vanilla spawners with the usual mobs and player range. Tower Spawners This is also used in the Tower expansion pack. These spawners only detect players within a spherical 8 blocks distance, as opposed to vanilla's 16 block limit. Note: The Hermitcraft release of this spawner set had a blaze riding a spider in place of the Cloud Dancer. This was removed due to blaze often setting wooden towers and surrounding trees alight. Custom Chests The contents of custom chests are calculated based on their coordinates, their height, and the bedrock in the column directly below them. Chests randomly choose a base of "junk" items as a template and then insert up to four loot items into the center of the chest. The junk base is chosen based entirely on the bedrock in the column below the chest, meaning that two chests in the same vertical column will always have the same junk base, but not necessarily the same loot items. Once the base chests has been chosen, a formula developed by Crazyman47 is applied to the chest which generates four numbers; each number is used for a different slot in the chest where the number indicates what item should appear in a slot. The number range changes depending on the chest's height, meaning items can only be found in chests at certain heights. This allows deep dungeons to have a higher chance of getting better loot than dungeons closer to the surface, and allows towers to have their own tower-themed loot range. Some numbers are left blank so that there's a chance that no item appears in one or more slots. //some pseudo code showing the calculations used to populate chests. //get chest coordinates x = chestX; y = chestY; z = chestZ; //choose random prime numbers based on bedrock existance at each height if(bedrockAtY1){ b1 = 4211; } else{ b1 = 4217; } if(bedrockAtY2){ b2 = 4219;} else{b2 = 4229;} if(bedrockAtY3){ b3 = 4231;} else{b3 = 4241;} if(bedrockAtY4){ b4 = 4243;} else{b4 = 4253;} //if x or z coordinate of chest is negative, make it positive. if(x<0){ x = x*-1; } if(z<0){ z = z*-1; } //get the item number for each of the four items item1 = (((x * z) * b1) % 51) + (y / 2); item2 = (((x % z) * b2) % 51) + (y / 2); item3 = (((z % x) * b3) % 51) + (y / 2); item4 = (((x + z) * b4) % 51) + (y / 2); //the item number is then used by the redstone to insert the item of that number for that slot into the chest Slot 4 is reserved for OTHER modules to add items to chests. For example Heart Canisters could add canisters to dungeons and/or towers by taking up one of the free slots left in the table. So far no modules support custom terrain, but this will change once the module is released so that various items belonging to certain modules can be found if that module is installed. Loot Table See More History Category:Custom Terrain Category:Custom Structures Category:Hermitcraft Gamemode 4 Category:Expansion Packs Category:Public Server III Category:All Modules